﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;

using LMD.Constant;
using LMD.Lib.Controls;

public class LOV_UFTFilterTema : LMD.Lib.Interface.ILOVProvider
{
    public LOV_UFTFilterTema()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    #region ILOVProvider Members

    public String DrawLOV(string sxControlId, string sxFilter, string sxCustomParam, int iIndex, int iPageSize)
    {
        sxFilter = sxFilter.Trim();
        Cached.EventTemaTable cachedEventTema = new Cached.EventTemaTable();
        DataTable dtEventTema = cachedEventTema.GetTema();
        return CustomControls.Create_LOVDrawer(sxControlId, dtEventTema, iIndex, iPageSize, sxFilter, "T_RELATION_EVENT_ID",
            "CODE","FilterTema()", false);
    }


    public String ShowInputForm(string sxControlId, string sxValue, string sxCustomParam)
    {
        // DI SINI BUAT FORM BUAT INPUT CONTACT PERSON BARU

        String sxOutput = String.Empty;
        sxOutput = CustomControls.BuildEditor_PopupNewLOVItem(sxControlId, GetLOVName(), sxValue, false);
        return sxOutput;
    }

    public string GetLOVName()
    {
        return KLOV.CourtesyCall.COMPANYLIST;
    }

    public string Insert2LOV(string sxValue, string sxCustomParam, TextboxType tpTextbox)
    {
        String newId = "333";

        /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         * THIS SHOULD BE INSERT NEW DATA TO DATABASE AND RETRIEVED THE NEW ID 
         * IF DATA IS CACHED, REFRESH THE CACHE PLEASE
         */

        return newId;
    }

    #endregion
}
